/* 
 * Virtual Bank System - Components CSS
 * UI components styles
 */

/* Card Styles */
.card {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--divider-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: var(--spacing-md);
}

.card-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--divider-color);
  background-color: rgba(0, 0, 0, 0.02);
}

/* Form Styles */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--title-color);
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  outline: none;
  transition: border-color 0.3s;
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(61, 133, 198, 0.2);
}

.form-error {
  color: var(--error-color);
  font-size: 12px;
  margin-top: var(--spacing-xs);
}

.form-textarea {
  height: auto;
  min-height: 80px;
  padding: var(--spacing-sm) var(--spacing-md);
  resize: vertical;
}

/* Button Styles */
.btn {
  height: 40px;
  padding: 0 var(--spacing-md);
  border: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #12296b;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #2b6eaa;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #46a619;
}

.btn-warning {
  background-color: var(--warning-color);
  color: white;
}

.btn-warning:hover {
  background-color: #e09b13;
}

.btn-error {
  background-color: var(--error-color);
  color: white;
}

.btn-error:hover {
  background-color: #d91a25;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-outline:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

.btn-link {
  background-color: transparent;
  border: none;
  color: var(--secondary-color);
  padding: 0;
  height: auto;
}

.btn-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.btn-lg {
  height: 48px;
  font-size: 16px;
  padding: 0 var(--spacing-lg);
}

.btn-sm {
  height: 32px;
  font-size: 12px;
  padding: 0 var(--spacing-sm);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-icon {
  margin-right: var(--spacing-sm);
}

.btn + .btn {
  margin-left: var(--spacing-sm);
}

/* Table Styles */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background-color: rgba(0, 0, 0, 0.02);
  font-weight: 600;
  text-align: left;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--divider-color);
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background-color: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

.badge-warning {
  background-color: rgba(250, 173, 20, 0.1);
  color: var(--warning-color);
}

.badge-error {
  background-color: rgba(245, 34, 45, 0.1);
  color: var(--error-color);
}

.badge-info {
  background-color: rgba(24, 144, 255, 0.1);
  color: var(--info-color);
}

/* Alert Styles */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--border-radius-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
}

.alert-icon {
  margin-right: var(--spacing-md);
  font-size: 16px;
}

.alert-success {
  background-color: rgba(82, 196, 26, 0.1);
  border: 1px solid var(--success-color);
  color: var(--success-color);
}

.alert-warning {
  background-color: rgba(250, 173, 20, 0.1);
  border: 1px solid var(--warning-color);
  color: var(--warning-color);
}

.alert-error {
  background-color: rgba(245, 34, 45, 0.1);
  border: 1px solid var(--error-color);
  color: var(--error-color);
}

.alert-info {
  background-color: rgba(24, 144, 255, 0.1);
  border: 1px solid var(--info-color);
  color: var(--info-color);
}

/* Modal Styles */
/* 模态框显示时的动画 */
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 模态框退出时的动画 */
@keyframes modal-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-50px);
  }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}

.modal-dialog {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--modal-shadow);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.3s ease-out;
}

.modal-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--divider-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--light-text);
}

.modal-close:hover {
  color: var(--error-color);
}

.modal-body {
  padding: var(--spacing-md);
}

.modal-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--divider-color);
  display: flex;
  justify-content: flex-end;
}

/* Loader Styles */
.loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

.loader {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--secondary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

/* Toast Styles */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
}

.toast {
  padding: var(--spacing-md);
  border-radius: var(--border-radius-md);
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  min-width: 250px;
  animation: toast-in 0.3s ease-out;
}

.toast-exit {
  animation: toast-exit 0.3s ease-out forwards;
}

.toast-success {
  background-color: white;
  border-left: 4px solid var(--success-color);
}

.toast-error {
  background-color: white;
  border-left: 4px solid var(--error-color);
}

.toast-warning {
  background-color: white;
  border-left: 4px solid var(--warning-color);
}

.toast-info {
  background-color: white;
  border-left: 4px solid var(--info-color);
}

.toast-icon {
  margin-right: var(--spacing-md);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--light-text);
  font-size: 16px;
}

/* Dashboard Cards */
.stat-card {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  padding: var(--spacing-md);
  background-color: white;
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(61, 133, 198, 0.1);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: var(--spacing-md);
}

.stat-card-content {
  flex: 1;
}

.stat-card-title {
  color: var(--light-text);
  font-size: 14px;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--title-color);
}

/* Progress Bar */
.progress {
  height: 8px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin: var(--spacing-sm) 0;
}

.progress-bar {
  height: 100%;
  background-color: var(--secondary-color);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Financial Product Card */
.product-card {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.3s;
  background-color: white;
  margin-bottom: var(--spacing-md);
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card-header {
  background-color: var(--primary-color);
  color: white;
  padding: var(--spacing-md);
}

.product-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-card-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

.product-card-body {
  padding: var(--spacing-md);
}

.product-card-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.product-card-label {
  color: var(--light-text);
  font-size: 12px;
}

.product-card-value {
  font-weight: 500;
}

.product-card-return {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-color);
  margin: var(--spacing-sm) 0;
}

.product-card-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--divider-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Risk Level Badges */
.risk-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.risk-low {
  background-color: rgba(82, 196, 26, 0.1);
  color: var(--success-color);
}

.risk-medium {
  background-color: rgba(250, 173, 20, 0.1);
  color: var(--warning-color);
}

.risk-high {
  background-color: rgba(245, 34, 45, 0.1);
  color: var(--error-color);
}

/* Login/Register Page */
.auth-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-color);
}

.auth-banner {
  flex: 1;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: white;
}

.auth-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  padding: var(--spacing-xl);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.auth-logo {
  margin-bottom: var(--spacing-md);
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--title-color);
  margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
  color: var(--light-text);
}

.auth-form {
  margin-bottom: var(--spacing-lg);
}

.auth-footer {
  text-align: center;
  color: var(--light-text);
  font-size: 13px;
}

.auth-footer a {
  color: var(--secondary-color);
}
